home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1997 October: Mac OS SDK / Dev.CD Oct 97 SDK1.toast / Development Kits (Disc 1) / Interfaces&Libraries / Universal / Interfaces / PInterfaces / QD3DExtension.p < prev    next >
Encoding:
Text File  |  1997-08-12  |  8.5 KB  |  277 lines  |  [TEXT/MPS ]

  1. {
  2.      File:        QD3DExtension.p
  3.  
  4.      Contains:    QuickDraw 3D Plug-in Architecture     Interface File.                                
  5.  
  6.      Version:    Technology:    Quickdraw 3D 1.5.1
  7.                  Release:    Universal Interfaces 3.0.1
  8.  
  9.      Copyright:    © 1995-1997 by Apple Computer, Inc., all rights reserved.
  10.  
  11.      Bugs?:        Please include the the file and version information (from above) with
  12.                  the problem description.  Developers belonging to one of the Apple
  13.                  developer programs can submit bug reports to:
  14.  
  15.                      devsupport@apple.com
  16.  
  17. }
  18. {$IFC UNDEFINED UsingIncludes}
  19. {$SETC UsingIncludes := 0}
  20. {$ENDC}
  21.  
  22. {$IFC NOT UsingIncludes}
  23.  UNIT QD3DExtension;
  24.  INTERFACE
  25. {$ENDC}
  26.  
  27. {$IFC UNDEFINED __QD3DEXTENSION__}
  28. {$SETC __QD3DEXTENSION__ := 1}
  29.  
  30. {$I+}
  31. {$SETC QD3DExtensionIncludes := UsingIncludes}
  32. {$SETC UsingIncludes := 1}
  33.  
  34. {$IFC UNDEFINED __QD3D__}
  35. {$I QD3D.p}
  36. {$ENDC}
  37. {$IFC UNDEFINED __QD3DERRORS__}
  38. {$I QD3DErrors.p}
  39. {$ENDC}
  40.  
  41.  
  42. {$PUSH}
  43. {$ALIGN POWER}
  44. {$LibExport+}
  45.  
  46. {*****************************************************************************
  47.  **                                                                             **
  48.  **                                Constants                                      **
  49.  **                                                                             **
  50.  ****************************************************************************}
  51. {$IFC TARGET_OS_MAC }
  52.  
  53. CONST
  54.     kQ3XExtensionMacCreatorType    = 'Q3XT';
  55.     kQ3XExtensionMacFileType    = 'shlb';
  56.  
  57. {$ENDC}  {TARGET_OS_MAC}
  58.  
  59.  
  60. {*****************************************************************************
  61.  **                                                                             **
  62.  **                                Object Method types                              **
  63.  **                                                                             **
  64.  ****************************************************************************}
  65.  
  66. CONST
  67.     kQ3XMethodTypeObjectClassVersion = 'vrsn';
  68.  
  69.  
  70. TYPE
  71.     TQ3XObjectClassVersion                = LONGINT;
  72.  
  73. CONST
  74.     kQ3XMethodTypeObjectClassRegister = 'rgst';
  75.  
  76.  
  77. TYPE
  78.     TQ3XObjectClassRegisterMethod = ProcPtr;  { FUNCTION TQ3XObjectClassRegisterMethod(objectClass: TQ3XObjectClass; classPrivate: UNIV Ptr): TQ3Status; C; }
  79.  
  80.  
  81. CONST
  82.     kQ3XMethodTypeObjectClassReplace = 'rgrp';
  83.  
  84.  
  85. TYPE
  86.     TQ3XObjectClassReplaceMethod = ProcPtr;  { PROCEDURE TQ3XObjectClassReplaceMethod(oldObjectClass: TQ3XObjectClass; oldClassPrivate: UNIV Ptr; newObjectClass: TQ3XObjectClass; newClassPrivate: UNIV Ptr); C; }
  87.  
  88.  
  89. CONST
  90.     kQ3XMethodTypeObjectClassUnregister = 'unrg';
  91.  
  92.  
  93. TYPE
  94.     TQ3XObjectClassUnregisterMethod = ProcPtr;  { PROCEDURE TQ3XObjectClassUnregisterMethod(objectClass: TQ3XObjectClass; classPrivate: UNIV Ptr); C; }
  95.  
  96.  
  97. CONST
  98.     kQ3XMethodTypeObjectNew        = 'newo';
  99.  
  100.  
  101. TYPE
  102.     TQ3XObjectNewMethod = ProcPtr;  { FUNCTION TQ3XObjectNewMethod(object: TQ3Object; privateData: UNIV Ptr; parameters: UNIV Ptr): TQ3Status; C; }
  103.  
  104.  
  105. CONST
  106.     kQ3XMethodTypeObjectDelete    = 'dlte';
  107.  
  108.  
  109. TYPE
  110.     TQ3XObjectDeleteMethod = ProcPtr;  { PROCEDURE TQ3XObjectDeleteMethod(object: TQ3Object; privateData: UNIV Ptr); C; }
  111.  
  112.  
  113. CONST
  114.     kQ3XMethodTypeObjectDuplicate = 'dupl';
  115.  
  116.  
  117. TYPE
  118.     TQ3XObjectDuplicateMethod = ProcPtr;  { FUNCTION TQ3XObjectDuplicateMethod(fromObject: TQ3Object; fromPrivateData: UNIV Ptr; toObject: TQ3Object; toPrivateData: UNIV Ptr): TQ3Status; C; }
  119.  
  120.     TQ3XSharedLibraryRegister = ProcPtr;  { FUNCTION TQ3XSharedLibraryRegister: TQ3Status; C; }
  121.  
  122. {*****************************************************************************
  123.  **                                                                             **
  124.  **                            Object Hierarchy Registration                      **
  125.  **                                                                             **
  126.  ****************************************************************************}
  127. {
  128.  *    Q3XObjectHierarchy_RegisterClass
  129.  *    
  130.  *    Register an object class in the QuickDraw 3D hierarchy.
  131.  *    
  132.  *    parentType            - an existing type in the hierarchy, or 0 to subclass
  133.  *                            TQ3Object
  134.  *    objectType            - the new object class type, used in the binary 
  135.  *                        metafile.  This is assigned at run time and returned
  136.  *                          to you.
  137.  *    objectName            - the new object name, used in the text metafile
  138.  *    metaHandler            - a TQ3XMetaHandler (may be NULL for some classes) 
  139.  *                          which returns non-virtual methods
  140.  *    virtualMetaHandler    - a TQ3XMetaHandler (may be NULL as well) which returns
  141.  *                            virtual methods a child would inherit
  142.  *    methodsSize            - the size of the class data needed (see 
  143.  *                            GetClassPrivate calls below)
  144.  *    instanceSize        - the size of the object instance data needed (see 
  145.  *                            GetPrivate calls below)
  146.  }
  147. FUNCTION Q3XObjectHierarchy_RegisterClass(parentType: TQ3ObjectType; VAR objectType: TQ3ObjectType; objectName: CStringPtr; metaHandler: TQ3XMetaHandler; virtualMetaHandler: TQ3XMetaHandler; methodsSize: LONGINT; instanceSize: LONGINT): TQ3XObjectClass; C;
  148. {
  149.  *    Q3XObjectHierarchy_UnregisterClass
  150.  *    
  151.  *    Returns kQ3Failure if the objectClass still has objects 
  152.  * around; the class remains registered.
  153.  }
  154. FUNCTION Q3XObjectHierarchy_UnregisterClass(objectClass: TQ3XObjectClass): TQ3Status; C;
  155. {
  156.  *    Q3XObjectHierarchy_GetMethod
  157.  *    
  158.  *    For use in TQ3XObjectClassRegisterMethod call
  159.  }
  160. FUNCTION Q3XObjectClass_GetMethod(objectClass: TQ3XObjectClass; methodType: TQ3XMethodType): TQ3XFunctionPointer; C;
  161. {
  162.  *    Q3XObjectHierarchy_NewObject
  163.  *    
  164.  *    To create a new object. Parameters is passed into the 
  165.  *    TQ3XObjectNewMethod as the "parameters" parameter.
  166.  }
  167. FUNCTION Q3XObjectHierarchy_NewObject(objectClass: TQ3XObjectClass; parameters: UNIV Ptr): TQ3Object; C;
  168. {
  169.  *    Q3XObjectClass_GetLeafType
  170.  *    
  171.  *    Return the leaf type of a class.
  172.  }
  173. FUNCTION Q3XObjectClass_GetLeafType(objectClass: TQ3XObjectClass): LONGINT; C;
  174. {
  175.  *    Q3XObjectClass_GetVersion
  176.  *    This routine obtains the the version of a class, referenced by an
  177.  *    object class type.  Functions for getting the type are in QD3D.h,
  178.  *    if you have the class name.
  179.  }
  180. FUNCTION Q3XObjectHierarchy_GetClassVersion(objectClassType: TQ3ObjectType; VAR version: TQ3XObjectClassVersion): TQ3Status; C;
  181. {
  182.  *    Q3XObjectClass_GetType 
  183.  *
  184.  *    This can be used to get the type, given a reference 
  185.  *    to a class.  This is most useful in the instance where you register a 
  186.  *    an element/attribute and need to get the type.  When you register an
  187.  *    element, QD3D will take the type you pass in and modify it (to avoid
  188.  *    namespace clashes).  Many object system calls require an object type
  189.  *    so this API call allows you to get the type from the class referernce
  190.  *    that you will ordinarily store when you register the class.
  191.  }
  192. FUNCTION Q3XObjectClass_GetType(objectClass: TQ3XObjectClass; VAR theType: TQ3ObjectType): TQ3Status; C;
  193.  
  194. FUNCTION Q3XObjectHierarchy_FindClassByType(theType: TQ3ObjectType): TQ3XObjectClass; C;
  195.  
  196.  
  197. {
  198.  *    Q3XObjectClass_GetPrivate
  199.  *    
  200.  *    Return a pointer to private instance data, a block of instanceSize bytes, 
  201.  *    from the Q3XObjectHierarchy_RegisterClass call.
  202.  *    
  203.  *    If instanceSize was zero, NULL is always returned.
  204.  }
  205. FUNCTION Q3XObjectClass_GetPrivate(objectClass: TQ3XObjectClass; targetObject: TQ3Object): Ptr; C;
  206. {
  207.  * Return the "TQ3XObjectClass" of an object
  208.  }
  209. FUNCTION Q3XObject_GetClass(object: TQ3Object): TQ3XObjectClass; C;
  210.  
  211.  
  212. {*****************************************************************************
  213.  **                                                                             **
  214.  **                    Shared Library Registration Entry Point                      **
  215.  **                                                                             **
  216.  ****************************************************************************}
  217.  
  218. TYPE
  219.     TQ3XSharedLibraryInfoPtr = ^TQ3XSharedLibraryInfo;
  220.     TQ3XSharedLibraryInfo = RECORD
  221.         registerFunction:        TQ3XSharedLibraryRegister;
  222.         sharedLibrary:            LONGINT;
  223.     END;
  224.  
  225. FUNCTION Q3XSharedLibrary_Register(VAR sharedLibraryInfo: TQ3XSharedLibraryInfo): TQ3Status; C;
  226. FUNCTION Q3XSharedLibrary_Unregister(sharedLibrary: LONGINT): TQ3Status; C;
  227.  
  228. {*****************************************************************************
  229.  **                                                                             **
  230.  **                                Posting Errors                                  **
  231.  **                                                                             **
  232.  **            You may only call these functions from within an extension         **
  233.  **                                                                             **
  234.  ****************************************************************************}
  235. {
  236.  *    Q3XError_Post
  237.  *    
  238.  *    Post a QuickDraw 3D Error from an extension.
  239.  }
  240. PROCEDURE Q3XError_Post(error: TQ3Error); C;
  241. {
  242.  *    Q3XWarning_Post
  243.  *    
  244.  *    Post a QuickDraw 3D Warning, from an extension.  Note the warning code you
  245.  *    pass into this routine must already be defined in the table above.
  246.  }
  247. PROCEDURE Q3XWarning_Post(warning: TQ3Warning); C;
  248. {
  249.  *    Q3XNotice_Post
  250.  *    
  251.  *    Post a QuickDraw 3D Notice, from an extension.  Note the notice code you
  252.  *    pass into this routine must already be defined in the table above.
  253.  }
  254. PROCEDURE Q3XNotice_Post(notice: TQ3Notice); C;
  255.  
  256. {$IFC TARGET_OS_MAC }
  257. {
  258.  *    Q3XMacintoshError_Post
  259.  *    
  260.  *    Post the QuickDraw 3D Error, kQ3ErrorMacintoshError, and the Macintosh
  261.  *    OSErr macOSErr. (Retrieved with Q3MacintoshError_Get)
  262.  }
  263. PROCEDURE Q3XMacintoshError_Post(macOSErr: OSErr); C;
  264. {$ENDC}  {TARGET_OS_MAC}
  265.  
  266.  
  267. {$ALIGN RESET}
  268. {$POP}
  269.  
  270. {$SETC UsingIncludes := QD3DExtensionIncludes}
  271.  
  272. {$ENDC} {__QD3DEXTENSION__}
  273.  
  274. {$IFC NOT UsingIncludes}
  275.  END.
  276. {$ENDC}
  277.